package com.yuyou.fn.educational.service.impl;

import com.github.wens.framework.service.impl.SuperServiceImpl;
import com.github.wens.mybatisplus.examples.Example;
import com.yuyou.fn.educational.entity.StudySection;
import com.yuyou.fn.educational.mapper.StudySectionMapper;
import com.yuyou.fn.educational.service.IStudySectionService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * StudySection 表数据服务层接口实现类
 *
 */
@Service
public class StudySectionServiceImpl extends SuperServiceImpl<StudySectionMapper, StudySection,Long> implements IStudySectionService {

    @Override
    @Cacheable("CacheofStudySectionId")
    public List<StudySection> findBySectionId(Long sectionId) {
        Example<StudySection>  example=StudySection.createExample();
        example.createCriteria().andEqualTo("sectionId",sectionId);
        return this.findListByExample(example);
    }

    @Override
    public List<StudySection> findBySectionIds(List<Long> sectionIds) {
        Example<StudySection>  example=StudySection.createExample();
        example.createCriteria().andIn("sectionId",sectionIds);
        return this.findListByExample(example);
    }
}